import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';

import { Util } from '../../utils/util';

import { BrandDetailService } from './brand.detail.page.service';

import { AsyncLocalStorage } from 'angular-async-local-storage';

@Component({
  selector: 'app-brand-detail',
  templateUrl: './brand.detail.page.html',
  providers: [BrandDetailService]
})
export class BrandDetailPage implements OnInit {




  // 品牌详情
  brandInfo: any;
  instest: boolean = false;

  constructor(private service: BrandDetailService, private util: Util,public asyncStore:AsyncLocalStorage) {

  }

  ngOnInit() {

    this.brandInfo = this.util.sessionStore().get('brandDetail');

    this.getBrandInfo(this.brandInfo);
    this.getBrandDoubleInfo(this.brandInfo);
    this.getCatgoryHttp(this.brandInfo);

  }

  ngOnDestroy() {

    if (this.offEvent) {
      this.offEvent.unsubscribe();
    }

    if (this.offEvent2) {
      this.offEvent2.unsubscribe();
    }

    if(this.offDoubleEvent){
      this.offDoubleEvent.unsubscribe();
    }

    this.asyncStore.removeItem('brandCatgory').subscribe((res) => {
      console.log(res);
    });

  }




  offEvent: any;
  getBrandInfo(_brand) {


    let json = {
      brandName: _brand.brandName,
      categoryId: Number(_brand.categoryId || _brand.category),
      brandId: _brand.id
    };
    var res = {"code":0,"msg":"成功","data":{"t":{"id":"-1\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"-1","categoryName":"/","categoryLevel":0,"brandName":"new balance","sellAmount":5569,"tsellAmount":4215,"csellAmount":1263,"thksellAmount":21,"gsellAmount":70,"monthSellAmount":1039095,"monthTSellAmount":1002582,"monthCSellAmount":32778,"monthThkSellAmount":1068,"monthGSellAmount":2667,"sellMoney":1834940.19,"tsellMoney":1077847.05,"csellMoney":706854.14,"thksellMoney":9906.0,"gsellMoney":40333.0,"monthSellMoney":3.2061178074E8,"monthTSellMoney":3.001081916E8,"monthCSellMoney":1.844366248E7,"monthThkSellMoney":637228.6,"monthGSellMoney":1422698.06,"productNum":7465,"tproductNum":1787,"cproductNum":5068,"thkproductNum":127,"gproductNum":483,"shopNum":765,"tshopNum":35,"cshopNum":596,"thkshopNum":12,"gshopNum":122},"interest":true}};

      this.brandInfo = res.data.t;

      this.instest = res.data.interest;

   
  }

  offEvent2: any;
  getCatgoryHttp(_brand) {


    let json = {
      start: 0,
      rows: 30,
      brandName: _brand.brandName,
      leafCategory: 1,
      sort: 'sellMoney',
      sortType: 'desc',
      catName: _brand.categoryName === "/" ? '' : _brand.categoryName
    };

    var res = {"code":0,"msg":"成功","data":{"value":[{"id":"50012036\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012036","categoryName":"运动/户外/乐器--运动鞋new--跑步鞋","categoryLevel":3,"brandName":"new balance","sellAmount":1938,"tsellAmount":1285,"csellAmount":594,"thksellAmount":17,"gsellAmount":42,"monthSellAmount":777475,"monthTSellAmount":758003,"monthCSellAmount":16816,"monthThkSellAmount":868,"monthGSellAmount":1788,"sellMoney":774645.57,"tsellMoney":438926.55,"csellMoney":305668.02,"thksellMoney":8195.0,"gsellMoney":21856.0,"monthSellMoney":2.5205256133E8,"monthTSellMoney":2.417188456E8,"monthCSellMoney":8812137.12,"monthThkSellMoney":544687.75,"monthGSellMoney":976890.86,"productNum":4151,"tproductNum":1251,"cproductNum":2557,"thkproductNum":98,"gproductNum":245,"shopNum":451,"tshopNum":26,"cshopNum":352,"thkshopNum":9,"gshopNum":64},{"id":"50012341\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012341","categoryName":"童装玩具/孕产/用品--童鞋/婴儿鞋/亲子鞋--运动鞋","categoryLevel":3,"brandName":"new balance","sellAmount":1746,"tsellAmount":1689,"csellAmount":53,"thksellAmount":0,"gsellAmount":4,"monthSellAmount":112160,"monthTSellAmount":110003,"monthCSellAmount":1935,"monthThkSellAmount":2,"monthGSellAmount":220,"sellMoney":371028.13,"tsellMoney":355548.0,"csellMoney":14317.13,"thksellMoney":0.0,"gsellMoney":1163.0,"monthSellMoney":2.537473366E7,"monthTSellMoney":2.4780219E7,"monthCSellMoney":526662.66,"monthThkSellMoney":876.0,"monthGSellMoney":66976.0,"productNum":575,"tproductNum":132,"cproductNum":398,"thkproductNum":1,"gproductNum":44,"shopNum":83,"tshopNum":3,"cshopNum":58,"thkshopNum":1,"gshopNum":21},{"id":"50011721\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011721","categoryName":"运动/户外/乐器--运动服/休闲服装--运动羽绒服","categoryLevel":3,"brandName":"new balance","sellAmount":281,"tsellAmount":28,"csellAmount":247,"thksellAmount":0,"gsellAmount":6,"monthSellAmount":7777,"monthTSellAmount":2739,"monthCSellAmount":4981,"monthThkSellAmount":0,"monthGSellAmount":57,"sellMoney":268766.0,"tsellMoney":21754.0,"csellMoney":239046.0,"thksellMoney":0.0,"gsellMoney":7966.0,"monthSellMoney":7011003.34,"monthTSellMoney":1494200.0,"monthCSellMoney":5427287.34,"monthThkSellMoney":0.0,"monthGSellMoney":89516.0,"productNum":229,"tproductNum":8,"cproductNum":209,"thkproductNum":0,"gproductNum":12,"shopNum":64,"tshopNum":2,"cshopNum":58,"thkshopNum":0,"gshopNum":4},{"id":"50012347\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012347","categoryName":"童装玩具/孕产/用品--童鞋/婴儿鞋/亲子鞋--靴子/雪地靴","categoryLevel":3,"brandName":"new balance","sellAmount":650,"tsellAmount":650,"csellAmount":0,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":16798,"monthTSellAmount":16649,"monthCSellAmount":137,"monthThkSellAmount":0,"monthGSellAmount":12,"sellMoney":152690.0,"tsellMoney":152690.0,"csellMoney":0.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":3990103.0,"monthTSellMoney":3943087.0,"monthCSellMoney":43170.0,"monthThkSellMoney":0.0,"monthGSellMoney":3846.0,"productNum":23,"tproductNum":9,"cproductNum":10,"thkproductNum":0,"gproductNum":4,"shopNum":11,"tshopNum":1,"cshopNum":7,"thkshopNum":0,"gshopNum":3},{"id":"50012345\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012345","categoryName":"童装玩具/孕产/用品--童鞋/婴儿鞋/亲子鞋--学步鞋/婴儿步前鞋","categoryLevel":3,"brandName":"new balance","sellAmount":459,"tsellAmount":459,"csellAmount":0,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":33654,"monthTSellAmount":33622,"monthCSellAmount":27,"monthThkSellAmount":0,"monthGSellAmount":5,"sellMoney":83101.0,"tsellMoney":83101.0,"csellMoney":0.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":6650523.85,"monthTSellMoney":6644628.0,"monthCSellMoney":4430.85,"monthThkSellMoney":0.0,"monthGSellMoney":1465.0,"productNum":44,"tproductNum":38,"cproductNum":4,"thkproductNum":0,"gproductNum":2,"shopNum":6,"tshopNum":1,"cshopNum":3,"thkshopNum":0,"gshopNum":2},{"id":"50012043\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012043","categoryName":"运动/户外/乐器--运动鞋new--板鞋/休闲鞋","categoryLevel":3,"brandName":"new balance","sellAmount":127,"tsellAmount":33,"csellAmount":91,"thksellAmount":2,"gsellAmount":1,"monthSellAmount":47881,"monthTSellAmount":45614,"monthCSellAmount":1995,"monthThkSellAmount":127,"monthGSellAmount":145,"sellMoney":47163.0,"tsellMoney":9294.0,"csellMoney":36631.0,"thksellMoney":890.0,"gsellMoney":348.0,"monthSellMoney":1.369082797E7,"monthTSellMoney":1.2694693E7,"monthCSellMoney":868906.78,"monthThkSellMoney":62634.99,"monthGSellMoney":64593.2,"productNum":513,"tproductNum":50,"cproductNum":416,"thkproductNum":17,"gproductNum":30,"shopNum":171,"tshopNum":11,"cshopNum":139,"thkshopNum":5,"gshopNum":16},{"id":"50011717\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011717","categoryName":"运动/户外/乐器--运动服/休闲服装--运动卫衣/套头衫","categoryLevel":3,"brandName":"new balance","sellAmount":93,"tsellAmount":14,"csellAmount":77,"thksellAmount":1,"gsellAmount":1,"monthSellAmount":19715,"monthTSellAmount":17805,"monthCSellAmount":1851,"monthThkSellAmount":43,"monthGSellAmount":16,"sellMoney":28378.0,"tsellMoney":4404.0,"csellMoney":23379.0,"thksellMoney":222.0,"gsellMoney":373.0,"monthSellMoney":4569348.8,"monthTSellMoney":3980778.0,"monthCSellMoney":572676.8,"monthThkSellMoney":9546.0,"monthGSellMoney":6348.0,"productNum":360,"tproductNum":41,"cproductNum":308,"thkproductNum":1,"gproductNum":10,"shopNum":98,"tshopNum":7,"cshopNum":86,"thkshopNum":1,"gshopNum":4},{"id":"50011720\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011720","categoryName":"运动/户外/乐器--运动服/休闲服装--运动棉衣","categoryLevel":3,"brandName":"new balance","sellAmount":28,"tsellAmount":0,"csellAmount":28,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":2989,"monthTSellAmount":2247,"monthCSellAmount":742,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":23673.0,"tsellMoney":0.0,"csellMoney":23673.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":1636394.82,"monthTSellMoney":1008903.0,"monthCSellMoney":627491.82,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":52,"tproductNum":1,"cproductNum":51,"thkproductNum":0,"gproductNum":0,"shopNum":24,"tshopNum":1,"cshopNum":23,"thkshopNum":0,"gshopNum":0},{"id":"50023107\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50023107","categoryName":"运动/户外/乐器--运动服/休闲服装--运动裤--运动长裤","categoryLevel":4,"brandName":"new balance","sellAmount":39,"tsellAmount":4,"csellAmount":35,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":8716,"monthTSellAmount":7898,"monthCSellAmount":818,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":12609.0,"tsellMoney":1354.0,"csellMoney":11255.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":2004360.93,"monthTSellMoney":1754980.0,"monthCSellMoney":249380.93,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":232,"tproductNum":38,"cproductNum":194,"thkproductNum":0,"gproductNum":0,"shopNum":66,"tshopNum":2,"cshopNum":64,"thkshopNum":0,"gshopNum":0},{"id":"50008899\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50008899","categoryName":"女装/男装/内衣--女装/女士精品--羽绒服","categoryLevel":3,"brandName":"new balance","sellAmount":10,"tsellAmount":3,"csellAmount":7,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":151,"monthTSellAmount":25,"monthCSellAmount":126,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":11168.61,"tsellMoney":1948.5,"csellMoney":9220.11,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":195415.94,"monthTSellMoney":16237.5,"monthCSellMoney":179178.44,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":20,"tproductNum":1,"cproductNum":19,"thkproductNum":0,"gproductNum":0,"shopNum":8,"tshopNum":1,"cshopNum":7,"thkshopNum":0,"gshopNum":0},{"id":"50011167\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011167","categoryName":"女装/男装/内衣--男装--羽绒服","categoryLevel":3,"brandName":"new balance","sellAmount":15,"tsellAmount":0,"csellAmount":15,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":273,"monthTSellAmount":76,"monthCSellAmount":193,"monthThkSellAmount":0,"monthGSellAmount":4,"sellMoney":10486.0,"tsellMoney":0.0,"csellMoney":10486.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":197731.0,"monthTSellMoney":49362.0,"monthCSellMoney":144091.0,"monthThkSellMoney":0.0,"monthGSellMoney":4278.0,"productNum":19,"tproductNum":1,"cproductNum":16,"thkproductNum":0,"gproductNum":2,"shopNum":11,"tshopNum":1,"cshopNum":8,"thkshopNum":0,"gshopNum":2},{"id":"50011739\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011739","categoryName":"运动/户外/乐器--运动服/休闲服装--运动茄克/外套","categoryLevel":3,"brandName":"new balance","sellAmount":18,"tsellAmount":3,"csellAmount":15,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":2153,"monthTSellAmount":1612,"monthCSellAmount":539,"monthThkSellAmount":1,"monthGSellAmount":1,"sellMoney":9746.0,"tsellMoney":2012.0,"csellMoney":7734.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":896047.26,"monthTSellMoney":651491.0,"monthCSellMoney":243675.4,"monthThkSellMoney":621.86,"monthGSellMoney":259.0,"productNum":227,"tproductNum":33,"cproductNum":192,"thkproductNum":1,"gproductNum":1,"shopNum":69,"tshopNum":3,"cshopNum":64,"thkshopNum":1,"gshopNum":1},{"id":"50014493\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50014493","categoryName":"运动/户外/乐器--运动包/户外包/配件--双肩背包","categoryLevel":3,"brandName":"new balance","sellAmount":23,"tsellAmount":1,"csellAmount":22,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":1351,"monthTSellAmount":812,"monthCSellAmount":535,"monthThkSellAmount":1,"monthGSellAmount":3,"sellMoney":6869.0,"tsellMoney":499.0,"csellMoney":6370.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":363313.59,"monthTSellMoney":201817.0,"monthCSellMoney":159559.59,"monthThkSellMoney":529.0,"monthGSellMoney":1408.0,"productNum":122,"tproductNum":22,"cproductNum":96,"thkproductNum":1,"gproductNum":3,"shopNum":58,"tshopNum":4,"cshopNum":50,"thkshopNum":1,"gshopNum":3},{"id":"50012064\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012064","categoryName":"运动/户外/乐器--运动鞋new--其它运动鞋","categoryLevel":3,"brandName":"new balance","sellAmount":8,"tsellAmount":0,"csellAmount":4,"thksellAmount":0,"gsellAmount":4,"monthSellAmount":102,"monthTSellAmount":0,"monthCSellAmount":56,"monthThkSellAmount":2,"monthGSellAmount":44,"sellMoney":5242.0,"tsellMoney":0.0,"csellMoney":2624.0,"thksellMoney":0.0,"gsellMoney":2618.0,"monthSellMoney":55950.24,"monthTSellMoney":0.0,"monthCSellMoney":31132.24,"monthThkSellMoney":2798.0,"monthGSellMoney":22020.0,"productNum":56,"tproductNum":0,"cproductNum":27,"thkproductNum":1,"gproductNum":28,"shopNum":22,"tshopNum":0,"cshopNum":16,"thkshopNum":1,"gshopNum":5},{"id":"50012044\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50012044","categoryName":"运动/户外/乐器--运动鞋new--帆布鞋","categoryLevel":3,"brandName":"new balance","sellAmount":10,"tsellAmount":0,"csellAmount":10,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":172,"monthTSellAmount":0,"monthCSellAmount":129,"monthThkSellAmount":0,"monthGSellAmount":43,"sellMoney":2940.0,"tsellMoney":0.0,"csellMoney":2940.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":54325.0,"monthTSellMoney":0.0,"monthCSellMoney":40586.0,"monthThkSellMoney":0.0,"monthGSellMoney":13739.0,"productNum":13,"tproductNum":0,"cproductNum":10,"thkproductNum":0,"gproductNum":3,"shopNum":11,"tshopNum":0,"cshopNum":8,"thkshopNum":0,"gshopNum":3},{"id":"50013228\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50013228","categoryName":"运动/户外/乐器--运动服/休闲服装--运动T恤","categoryLevel":3,"brandName":"new balance","sellAmount":13,"tsellAmount":5,"csellAmount":8,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":2175,"monthTSellAmount":1930,"monthCSellAmount":244,"monthThkSellAmount":0,"monthGSellAmount":1,"sellMoney":2728.0,"tsellMoney":984.0,"csellMoney":1744.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":346700.06,"monthTSellMoney":296474.9,"monthCSellMoney":50066.16,"monthThkSellMoney":0.0,"monthGSellMoney":159.0,"productNum":105,"tproductNum":45,"cproductNum":59,"thkproductNum":0,"gproductNum":1,"shopNum":49,"tshopNum":5,"cshopNum":43,"thkshopNum":0,"gshopNum":1},{"id":"50010158\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50010158","categoryName":"女装/男装/内衣--男装--夹克","categoryLevel":3,"brandName":"new balance","sellAmount":6,"tsellAmount":0,"csellAmount":2,"thksellAmount":0,"gsellAmount":4,"monthSellAmount":54,"monthTSellAmount":0,"monthCSellAmount":36,"monthThkSellAmount":0,"monthGSellAmount":18,"sellMoney":2504.0,"tsellMoney":0.0,"csellMoney":807.0,"thksellMoney":0.0,"gsellMoney":1697.0,"monthSellMoney":21197.12,"monthTSellMoney":0.0,"monthCSellMoney":13794.12,"monthThkSellMoney":0.0,"monthGSellMoney":7403.0,"productNum":29,"tproductNum":0,"cproductNum":17,"thkproductNum":0,"gproductNum":12,"shopNum":8,"tshopNum":0,"cshopNum":6,"thkshopNum":0,"gshopNum":2},{"id":"122690003\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"122690003","categoryName":"鞋靴/箱包/配件--箱包皮具/热销女包/男包--双肩背包","categoryLevel":3,"brandName":"new balance","sellAmount":9,"tsellAmount":0,"csellAmount":9,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":166,"monthTSellAmount":0,"monthCSellAmount":153,"monthThkSellAmount":0,"monthGSellAmount":13,"sellMoney":2182.29,"tsellMoney":0.0,"csellMoney":2182.29,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":38369.64,"monthTSellMoney":0.0,"monthCSellMoney":35618.64,"monthThkSellMoney":0.0,"monthGSellMoney":2751.0,"productNum":34,"tproductNum":0,"cproductNum":28,"thkproductNum":0,"gproductNum":6,"shopNum":12,"tshopNum":0,"cshopNum":10,"thkshopNum":0,"gshopNum":2},{"id":"50010518\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50010518","categoryName":"童装玩具/孕产/用品--童装/婴儿装/亲子装--卫衣/绒衫","categoryLevel":3,"brandName":"new balance","sellAmount":8,"tsellAmount":5,"csellAmount":3,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":363,"monthTSellAmount":314,"monthCSellAmount":49,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":2130.0,"tsellMoney":1422.0,"csellMoney":708.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":103033.65,"monthTSellMoney":91002.0,"monthCSellMoney":12031.65,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":27,"tproductNum":6,"cproductNum":21,"thkproductNum":0,"gproductNum":0,"shopNum":11,"tshopNum":2,"cshopNum":9,"thkshopNum":0,"gshopNum":0},{"id":"50011894\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50011894","categoryName":"珠宝/眼镜/手表--ZIPPO/瑞士军刀/眼镜--眼镜架","categoryLevel":3,"brandName":"new balance","sellAmount":5,"tsellAmount":5,"csellAmount":0,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":414,"monthTSellAmount":407,"monthCSellAmount":7,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":1625.0,"tsellMoney":1625.0,"csellMoney":0.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":137076.0,"monthTSellMoney":134667.0,"monthCSellMoney":2409.0,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":40,"tproductNum":35,"cproductNum":5,"thkproductNum":0,"gproductNum":0,"shopNum":7,"tshopNum":5,"cshopNum":2,"thkshopNum":0,"gshopNum":0},{"id":"124230010\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"124230010","categoryName":"童装玩具/孕产/用品--童装/婴儿装/亲子装--羽绒服饰/羽绒内胆--羽绒服","categoryLevel":4,"brandName":"new balance","sellAmount":1,"tsellAmount":0,"csellAmount":0,"thksellAmount":0,"gsellAmount":1,"monthSellAmount":234,"monthTSellAmount":62,"monthCSellAmount":106,"monthThkSellAmount":0,"monthGSellAmount":66,"sellMoney":1480.0,"tsellMoney":0.0,"csellMoney":0.0,"thksellMoney":0.0,"gsellMoney":1480.0,"monthSellMoney":194903.8,"monthTSellMoney":27813.0,"monthCSellMoney":79001.8,"monthThkSellMoney":0.0,"monthGSellMoney":88089.0,"productNum":43,"tproductNum":2,"cproductNum":27,"thkproductNum":0,"gproductNum":14,"shopNum":16,"tshopNum":1,"cshopNum":11,"thkshopNum":0,"gshopNum":4},{"id":"50026312\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50026312","categoryName":"运动/户外/乐器--运动鞋new--童鞋/青少年鞋","categoryLevel":3,"brandName":"new balance","sellAmount":6,"tsellAmount":0,"csellAmount":5,"thksellAmount":1,"gsellAmount":0,"monthSellAmount":76,"monthTSellAmount":1,"monthCSellAmount":64,"monthThkSellAmount":10,"monthGSellAmount":1,"sellMoney":1474.0,"tsellMoney":0.0,"csellMoney":875.0,"thksellMoney":599.0,"gsellMoney":0.0,"monthSellMoney":19661.7,"monthTSellMoney":145.0,"monthCSellMoney":13378.7,"monthThkSellMoney":5749.0,"monthGSellMoney":389.0,"productNum":37,"tproductNum":1,"cproductNum":31,"thkproductNum":4,"gproductNum":1,"shopNum":16,"tshopNum":1,"cshopNum":13,"thkshopNum":1,"gshopNum":1},{"id":"50023114\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50023114","categoryName":"运动/户外/乐器--运动服/休闲服装--运动马甲--羽绒马甲","categoryLevel":4,"brandName":"new balance","sellAmount":2,"tsellAmount":0,"csellAmount":1,"thksellAmount":0,"gsellAmount":1,"monthSellAmount":33,"monthTSellAmount":0,"monthCSellAmount":30,"monthThkSellAmount":0,"monthGSellAmount":3,"sellMoney":1260.0,"tsellMoney":0.0,"csellMoney":345.0,"thksellMoney":0.0,"gsellMoney":915.0,"monthSellMoney":15614.0,"monthTSellMoney":0.0,"monthCSellMoney":12869.0,"monthThkSellMoney":0.0,"monthGSellMoney":2745.0,"productNum":12,"tproductNum":0,"cproductNum":11,"thkproductNum":0,"gproductNum":1,"shopNum":11,"tshopNum":0,"cshopNum":10,"thkshopNum":0,"gshopNum":1},{"id":"50013618\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50013618","categoryName":"童装玩具/孕产/用品--童装/婴儿装/亲子装--裤子","categoryLevel":3,"brandName":"new balance","sellAmount":4,"tsellAmount":3,"csellAmount":1,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":386,"monthTSellAmount":306,"monthCSellAmount":80,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":950.0,"tsellMoney":741.0,"csellMoney":209.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":92738.9,"monthTSellMoney":75890.0,"monthCSellMoney":16848.9,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":35,"tproductNum":7,"cproductNum":28,"thkproductNum":0,"gproductNum":0,"shopNum":11,"tshopNum":2,"cshopNum":9,"thkshopNum":0,"gshopNum":0},{"id":"124208011\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"124208011","categoryName":"童装玩具/孕产/用品--童装/婴儿装/亲子装--羽绒服饰/羽绒内胆--羽绒马甲","categoryLevel":4,"brandName":"new balance","sellAmount":3,"tsellAmount":0,"csellAmount":3,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":37,"monthTSellAmount":0,"monthCSellAmount":36,"monthThkSellAmount":0,"monthGSellAmount":1,"sellMoney":837.3,"tsellMoney":0.0,"csellMoney":837.3,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":10634.4,"monthTSellMoney":0.0,"monthCSellMoney":10006.4,"monthThkSellMoney":0.0,"monthGSellMoney":628.0,"productNum":11,"tproductNum":0,"cproductNum":10,"thkproductNum":0,"gproductNum":1,"shopNum":9,"tshopNum":0,"cshopNum":8,"thkshopNum":0,"gshopNum":1},{"id":"50015374\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50015374","categoryName":"运动/户外/乐器--运动包/户外包/配件--运动袜","categoryLevel":3,"brandName":"new balance","sellAmount":27,"tsellAmount":23,"csellAmount":4,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":288,"monthTSellAmount":211,"monthCSellAmount":77,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":816.0,"tsellMoney":697.0,"csellMoney":119.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":8730.0,"monthTSellMoney":6715.6,"monthCSellMoney":2014.4,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":31,"tproductNum":11,"cproductNum":20,"thkproductNum":0,"gproductNum":0,"shopNum":16,"tshopNum":4,"cshopNum":12,"thkshopNum":0,"gshopNum":0},{"id":"50023423\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50023423","categoryName":"运动/户外/乐器--运动服/休闲服装--运动球服--棒球服","categoryLevel":4,"brandName":"new balance","sellAmount":3,"tsellAmount":0,"csellAmount":3,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":121,"monthTSellAmount":0,"monthCSellAmount":111,"monthThkSellAmount":0,"monthGSellAmount":10,"sellMoney":809.0,"tsellMoney":0.0,"csellMoney":809.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":43834.0,"monthTSellMoney":0.0,"monthCSellMoney":40344.0,"monthThkSellMoney":0.0,"monthGSellMoney":3490.0,"productNum":38,"tproductNum":0,"cproductNum":37,"thkproductNum":0,"gproductNum":1,"shopNum":18,"tshopNum":0,"cshopNum":17,"thkshopNum":0,"gshopNum":1},{"id":"50023113\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50023113","categoryName":"运动/户外/乐器--运动服/休闲服装--运动马甲--棉马甲","categoryLevel":4,"brandName":"new balance","sellAmount":2,"tsellAmount":0,"csellAmount":2,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":59,"monthTSellAmount":20,"monthCSellAmount":39,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":758.0,"tsellMoney":0.0,"csellMoney":758.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":32803.0,"monthTSellMoney":15360.0,"monthCSellMoney":17443.0,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":9,"tproductNum":1,"cproductNum":8,"thkproductNum":0,"gproductNum":0,"shopNum":8,"tshopNum":1,"cshopNum":7,"thkshopNum":0,"gshopNum":0},{"id":"122654005\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"122654005","categoryName":"鞋靴/箱包/配件--箱包皮具/热销女包/男包--男士包袋","categoryLevel":3,"brandName":"new balance","sellAmount":3,"tsellAmount":0,"csellAmount":3,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":112,"monthTSellAmount":0,"monthCSellAmount":102,"monthThkSellAmount":0,"monthGSellAmount":10,"sellMoney":662.0,"tsellMoney":0.0,"csellMoney":662.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":19850.0,"monthTSellMoney":0.0,"monthCSellMoney":18568.0,"monthThkSellMoney":0.0,"monthGSellMoney":1282.0,"productNum":30,"tproductNum":0,"cproductNum":28,"thkproductNum":0,"gproductNum":2,"shopNum":12,"tshopNum":0,"cshopNum":10,"thkshopNum":0,"gshopNum":2},{"id":"50017271\u0001new balance","date":"2017-12-03 00:00:00","categoryId":"50017271","categoryName":"运动/户外/乐器--运动/瑜伽/健身/球迷用品--田径运动器材--田径运动鞋","categoryLevel":4,"brandName":"new balance","sellAmount":1,"tsellAmount":0,"csellAmount":1,"thksellAmount":0,"gsellAmount":0,"monthSellAmount":20,"monthTSellAmount":0,"monthCSellAmount":20,"monthThkSellAmount":0,"monthGSellAmount":0,"sellMoney":598.0,"tsellMoney":0.0,"csellMoney":598.0,"thksellMoney":0.0,"gsellMoney":0.0,"monthSellMoney":8322.0,"monthTSellMoney":0.0,"monthCSellMoney":8322.0,"monthThkSellMoney":0.0,"monthGSellMoney":0.0,"productNum":5,"tproductNum":0,"cproductNum":5,"thkproductNum":0,"gproductNum":0,"shopNum":2,"tshopNum":0,"cshopNum":2,"thkshopNum":0,"gshopNum":0}],"count":64}};

      this.asyncStore.setItem('brandCatgory',res.data.value).subscribe((res) => {

        console.log(res);
      });


  }

  // 11.11预售
  brandDoble:any = {
    sellAmount: 0,
    dingJin: 0,
    sellMoney: 0
  };
  offDoubleEvent: any;
  getBrandDoubleInfo(_brand) {

    this.brandDoble = {
      sellAmount: 0,
      dingJin: 0,
      sellMoney: 0
    };

    let json = {
      brandName: _brand.brandName
    };

    var res = {"code":0,"msg":"成功","data":{"sellAmount":418692,"dingJin":1.328224E7,"sellMoney":9.7246488E7}};

      this.brandDoble = res.data;

  }
}
